/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved.
 * distributed with this file and available online at
 */
package com.lap.auth.application.job.assembler;

import com.lap.auth.application.job.command.CreateJobCmd;
import com.lap.auth.application.job.command.UpdateJobCmd;
import com.lap.auth.domain.job.Job;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
public interface JobAssembler {

  @Mapping(target = "id", ignore = true)
  @Mapping(target = "code", source = "code")
  @Mapping(target = "event", ignore = true)
  @Mapping(target = "updatedBy", ignore = true)
  @Mapping(target = "updateTime", ignore = true)
  @Mapping(target = "createdBy", ignore = true)
  @Mapping(target = "createTime", ignore = true)
  @Mapping(target = "tenantCode", ignore = true)
  Job toDomain(String code, CreateJobCmd cmd);

  @Mapping(target = "id", source = "id")
  @Mapping(target = "code", source = "code")
  @Mapping(target = "event", ignore = true)
  @Mapping(target = "updatedBy", ignore = true)
  @Mapping(target = "updateTime", ignore = true)
  @Mapping(target = "createdBy", ignore = true)
  @Mapping(target = "createTime", ignore = true)
  @Mapping(target = "tenantCode", ignore = true)
  Job toDomain(Integer id, String code, UpdateJobCmd cmd);
}
